# 发起人
from memorandum.memento import Memento


class Originator:

    def __init__(self):
        self._state = None

    def setState(self, state):
        self._state = state

    def getState(self):
        return self._state

    def createMemento(self):
        return Memento(self._state)

    def restoreMemento(self, memento):
        self.setState(memento.getState())
